<template>
  <view class="my">
    <view class="head">
      <view
        class="header"
        @tap="handleNavTos('/src/pages/my/pages/idDetails/index')"
      >
        <view class="header-image">
          <image src="/static/icon/head.jpg" v-if="!shopInfo.defaultHead"></image>
          <image :src="`${basic}${shopInfo.defaultHead}`" v-if="shopInfo.defaultHead"></image>
        </view>
        <view class="header-msg">
          <view>{{shopInfo.shopName}}</view>
          <view>账号:{{uesrId}}</view>
        </view>
        <view class="header-more">
          <image src="/static/more.png" mode='widthFix'></image>
        </view>
        <!-- <image src="/static/news.png" mode='widthFix' class="news"></image> -->
      </view>
    </view>
    <!-- <item v-for="(item, idx) in mySelfFunList" :key="idx" :item="item" @click="handleNavTo(item.url)"></item> -->
    <view v-for="(item,index) in iconList" :key='index' class="iconlistSec">
        <view class="iconlistSec-title">{{item.txt}}</view>
        <view class="iconlistSec-list">
          <view
            v-for="(items,inde) in item.children"
            :key="inde"
            class="iconlistSec-list-child"
			@click="handleNavTo(items)"
          >
            <image :src='items.src' mode='widthFix'></image>
            <view>{{items.txt}}</view>
          </view>
        </view>
      </view>
  </view>
</template>

<script>
import CONSTS from '@/src/consts';
import item from './components/item.vue'
import {getStoreInformation} from './api.js'
export default {
  data () {
    return {
		basic:CONSTS.BASE_URL+'/basic',
		uesrId:'',
		shopInfo:[],
		iconList:[
			{
				txt:'门店管理',
				children:[
					{txt:'相册管理',src:'/static/myicon/xc.png',url:'pages/albumSet/index'},
					{txt:'店铺管理',src:'/static/myicon/dp.png',url:'pages/detailSet/index'},
					{txt:'到店券管理',src:'/static/myicon/ddj.png',url:'pages/couponList/index'},
					// {txt:'资金管理',src:'/static/myicon/zjgl.png',url:'pages/fund/index'},
					],
			},
			{
				txt:'帮助中心',
				children:[
					{txt:'客服中心',src:'/static/myicon/kf.png',url:'pages/service/index'},
					{txt:'规则中心',src:'/static/myicon/gz.png',url:'pages/regulation/index'},
					{txt:'使用手册',src:'/static/myicon/sms.png',url:''},
					],
			},
			{
				txt:'通用设置',
				children:[
					{txt:'通知设置',src:'/static/myicon/tz.png',url:'pages/inform/index'},
					{txt:'意见反馈',src:'/static/myicon/yj.png',url:'pages/feedback/index'},
					{txt:'推荐给朋友',src:'/static/myicon/tj.png',url:'pages/share/index'},
					{txt:'关于我们',src:'/static/myicon/my.png',url:'pages/aboutUp/index'},
					],
			}
		]
     //  iconList: [{
     //    src: '/static/ic/1.png',
     //    txt: '输码验证'
     //  }, {
     //    src: '/static/ic/2.png',
     //    txt: '扫码验证'
     //  }, {
     //    src: '/static/ic/3.png',
     //    txt: '买单收款'
     //  }, {
     //    src: '/static/ic/4.png',
     //    txt: '订单管理'
     //  }],
	    
    
     //  mySelfFunList: [{
     //    title: '相册管理',
     //    icon: '/static/icon/xc.png',
     //    url: '/src/pages/my/pages/albumSet/index'
     //  },
     //  {
     //    title: '详情信息',
     //    icon: '/static/icon/xx.png',
     //    url: '/src/pages/my/pages/richTxt/pages/index/index'
     //  },
     //  // {
     //  //   title: '详情查看',
     //  //   icon: '/static/icon/xx.png',
     //  //   url: '/src/pages/my/pages/richTxtDetail/index'
     //  // }
     //  ]
    };
  },
  components: {
    item
  },
  methods: {
    handleNavTo (url) {
		console.log(url)
      uni.navigateTo({
        url: url.url
      });
    },
	handleNavTos (url) {
		console.log(url)
	  uni.navigateTo({
	    url: url
	  });
	},
    async listPush() {
    	let params = {
    		
    	}
    	try {
    		const {
    			data
    		} = await getStoreInformation(params)
    		console.log(data,7878787)
    		this.shopInfo = data
    	} catch (err) {
    		console.log(err)
    	}
    },
  },
  onShow () {
   const _self = this
   this.listPush()
    // uni.getStorage({
    //   key: 'shopInfo',
    //   success: function (res) {
    //     _self.shopInfo = res.data
    //   }
    // });
	uni.getStorage({
	  key: 'USER_INFO',
	  success: function (res) {
	    _self.uesrId = res.data.phone
	  }
	});
  }
}
</script>

<style lang="scss" scope>
  .iconlistSec {
    margin: 24rpx;
    background-color: #fff;
    border-radius: 20rpx;
	box-shadow:0rpx 6rpx 6rpx rgba(0,0,0,0.05);
    &-title {
      padding: 30rpx;
      font-size: 32rpx;
      font-family: PingFang SC;
      font-weight: bold;
      line-height: 38rpx;
      color: rgba(51, 51, 51, 1);
    }
    &-list {
      display: flex;
      justify-content: space-around;
      align-items: center;
      &-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        font-size: 26rpx;
        font-family: PingFang SC;
        font-weight: 400;
        line-height: 32rpx;
        color: rgba(90, 90, 90, 1);
        padding-bottom: 42rpx;
        image {
          width: 36rpx;
		  height: 36rpx;
          margin-bottom: 24rpx;
        }
      }
    }
  }
.news {
  width: 44rpx;
  position: absolute;
  right: 30rpx;
  top: 80rpx;
  // right: 30rpx;
}
.my {
  height: 90vh;
  .head {
    height: 300rpx;
    width: 100vw;
    background-color: #0cd4d3;
    display: flex;
    align-items: flex-end;
    position: relative;
  }
  .header {
    display: flex;
    align-items: center;
    padding: 32rpx 28rpx;
    &-more {
      position: absolute;
      right: 32rpx;
      image {
        width: 36rpx;
      }
    }
    &-msg {
      padding-left: 32rpx;
      display: flex;
      flex-direction: column;
      justify-content: center;
      color: #ffffff;
      view:nth-child(1) {
        font-size: 28rpx;
		margin-bottom: 18rpx;
      }

      view:nth-child(2) {
        font-size: 24rpx;
      }
    }

    &-image {
      width: 116rpx;
      height: 116rpx;
      border-radius: 116rpx;
      border: 2rpx solid #ffffff;
      background-color: #ffffff;
      overflow: hidden;

      image {
        width: 100%;
        height: 100%;
      }
    }
  }
}
</style>
